import wtforms

from validators import BaseForm, BasePageForm


class SchemaForm(BaseForm):
    """
    数据模型表单校验类
    """
    id = wtforms.IntegerField()
    schemaGroupId = wtforms.StringField("所属分组")
    tableName = wtforms.StringField("表名称", [wtforms.validators.DataRequired(message="表名称不能为空")])
    remark = wtforms.StringField("表注释", [wtforms.validators.DataRequired(message="表注释不能为空")])
    otherRemark = wtforms.StringField("额外说明")
    tableType = wtforms.StringField("表类型")
    formType = wtforms.StringField("表单类型")
    isTree = wtforms.StringField("是否树")
    sort = wtforms.StringField("排序")
    icon = wtforms.StringField("图标")
    searchFormKeys = wtforms.StringField("搜索表单key，可用于排序")
    listKeys = wtforms.StringField("列表key，可用于排序")
    variable = wtforms.StringField("扩展属性JSON")
    createUser = wtforms.StringField("创建用户")
    updateUser = wtforms.StringField("更新用户")
    ext = wtforms.Field("扩展属性JSON")


class SchemaPageForm(BasePageForm):
    """
    数据模型分页校验类
    """
    pass
